<?php $this->placeholder('container-class')->set('ad_detail domestic_help')?>
<?php
    $education = Model_Listing_Maid::getEducation();
    $languages = Model_Listing_Maid::getLanguages();
    $skilllevel = Model_Listing_Maid::getSkillLevel();
    $experience = Model_Listing_Maid::getYearExperience();    
    $nationality = Model_Listing_Maid::getNationality();
    $religion = Model_Listing_Maid::getReligion();
    $maritalstatus = Model_Listing_Maid::getMaritalStatus();
    $gender = Model_Listing_Maid::getGender();
    $horoscope = Model_Listing_Maid::getHoroscope();
    $chinesezodiac = Model_Listing_Maid::getChineseZodiac();
    $joblocation = Model_Listing_Maid::getLocation();
    $visastatus = Model_Listing_Maid::getVisastatus();
	$internal_lng = $this->listing->getInternalLanguage();

?>
<?php ob_start();?>

        <?php if (!empty($this->listing->dob)) {echo $this->dtDd($this->t('Age', $internal_lng), $this->listing->age, true);}?>
        <?php if (!empty($this->listing->maritalstatus)) {echo $this->dtDd($this->t('Marital Status', $internal_lng), $this->t($maritalstatus[$this->listing->maritalstatus], $internal_lng), true);}?>
        <?php if (!empty($this->listing->nationality)) {echo $this->dtDd($this->t('Nationality', $internal_lng), $this->t($nationality[$this->listing->nationality], $internal_lng), true);}?>
        <?php if (!empty($this->listing->religion)) {echo $this->dtDd($this->t('Religion', $internal_lng), $this->t($religion[$this->listing->religion], $internal_lng), true);}?>
        <?php if (!empty($this->listing->weight)) {echo $this->dtDd($this->t('Weight', $internal_lng), number_format($this->listing->weight).' kg', true);}?>
        <?php if (!empty($this->listing->gender)) {echo $this->dtDd($this->t('Gender', $internal_lng), $this->t($gender[$this->listing->gender], $internal_lng), true);}?>
        <?php if (!empty($this->listing->height)) {echo $this->dtDd($this->t('Height', $internal_lng), number_format($this->listing->height).' cm', true);}?>
        <?php if (!empty($this->listing->contact_number)) {echo $this->dtDd($this->t('Contact Number', $internal_lng), $this->listing->contact_number, true);}?>
        <?php if (!empty($this->listing->horoscope)) {echo $this->dtDd($this->t('Horoscope', $internal_lng), $horoscope[$this->listing->horoscope], true);}?>
        <?php if (!empty($this->listing->chinesezodiac)) {echo $this->dtDd($this->t('Chinese Zodiac', $internal_lng), $chinesezodiac[$this->listing->chinesezodiac], true);}?>
        <?php if (!empty($this->listing->descriptionmaid)) {echo $this->dtDd($this->t('Description', $internal_lng), $this->listing->descriptionmaid, true);}?>
	
<?php $content = trim(ob_get_clean())?>
<?php if (!empty($content)):?>
    <section class="category">
        <div id="detail_content_text_category">
            <section class="category">
                <h2><?php echo $this->t('Personal Information', $internal_lng)?></h2>        
                <?php echo $content ?>
            </section>
        </div>
    </section>
<?php endif;?>


<?php ob_start();
    

?>
    <?php
     $cooking = array('western', 'chinese');
     $test = false;
     foreach($cooking as $val) {
         if (!empty($this->listing->{'specialities'.$val})) {
             $test = true;
             break;
         }
         if (!empty($this->listing->{'skilllevel'.$val})) {
             $test = true;
             break;
         }     
     }
    ?>
    <?php if($test):?>
        <h2><?php echo $this->t('Skills & Experience', $internal_lng)?></h2>
        <dl class="cooking table">
            <dt><span class="title"><?php echo $this->t('Cooking Style', $internal_lng)?></span><span class="value"><?php echo $this->t('Skill Level', $internal_lng)?></span></dt>        
            <?php foreach($cooking as $val):?>
                <dd>
                    <span class="title"><?php echo $this->t(ucfirst($val), $internal_lng)?></span>
                    <span class="value">
                        <?php if (!empty($this->listing->{'skilllevel'.$val})):?>
                            <?php 
                                $tmp = $skilllevel[$this->listing->{'skilllevel'.$val}];
                                if (!empty($tmp)) {
                                    echo $this->t($tmp, $internal_lng);
                                } else {
                                    echo '-';
                                }
                            ?>
                        <?php else:?>
                            -
                        <?php endif;?>
                    </span>
                </dd>
            <?php endforeach;?>
            <?php if (!empty($this->listing->specialities)): ?>
                <dd>
                    <span class="title"><?php echo $this->t('Specialities', $internal_lng)?></span>
                    <span class="value">
                        <?php echo $this->listing->specialities?>
                    </span>
                </dd>
            <?php endif;?>
        </dl>
    <?php endif;?>

    <?php
     $cooking = array('newborn', 'children', 'disable', 'elderly');
     $test = false;
     foreach($cooking as $val) {
         if (!empty($this->listing->{'yearsexperience'.$val})) {
             $test = true;
             break;
         }
     }
    ?>
    <?php if($test):?>
        <dl class="care table">
            <dt><span class="title"><?php echo $this->t('People Care and Nursing', $internal_lng)?></span><span class="value"><?php echo $this->t('Years', $internal_lng)?></span></dt>                    
            <?php foreach($cooking as $val):?>
                <dd>
                    <span class="title"><?php echo $this->t(ucfirst($val), $internal_lng)?></span>
                    <span class="value"><?php 
                        $tmp = $this->listing->{'yearsexperience'.$val};
                        if (!empty($tmp)) {
                            if (!is_numeric($tmp)) {
                                $tmp = $experience[$tmp];
                                echo $tmp;
                            } else {
                                echo $this->t('__1__ years', $internal_lng, $tmp);
                            }
                        } else {
                            echo '-';
                        }

                    ?></span>
                </dd>
            <?php endforeach;?>
        </dl>
    <?php endif;?>
        
    <?php if(!empty($this->listing->yoe_country)):?>
    <dl class="oversea table">
        <dt><span class="title"><?php echo $this->t('Overseas Experience', $internal_lng)?></span><span class="value"><?php echo $this->t('Years', $internal_lng)?></span></dt>        
        <?php foreach($this->listing->yoe_country as $key => $val):?>
            <?php 
                $tmp = $experience[$val];
                if (empty($tmp)) {
                    continue;
                }
                $tmp = is_numeric($tmp) ? $tmp : Model_Listing_Maid::getYearExperience($tmp);
            ?>
            <dd>
                <span class="title"><?php echo $this->t(ucfirst($joblocation[$key]), $internal_lng)?></span>
                <span class="value">
                    <?php 
                        echo $this->t('__1__ years', $internal_lng, $tmp);
                    ?>                    
                </span>
            </dd>
        <?php endforeach;?>
    </dl>        
    <?php endif;?>
    <?php if (!empty($this->listing->education)) {echo $this->dtDd($this->t('Education', $internal_lng), $this->t($education[$this->listing->education], $internal_lng), 'education');}?>
    <?php
    if (!empty($this->listing->languages)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Maid::getLanguages();
        $to_add     = '';
        foreach ((array)$this->listing->languages as $data) {
            $field .= $to_add . $this->t($views[$data], $internal_lng);
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Languages', $internal_lng), $field, 'language');
    }
    ?>
    <?php
    if (!empty($this->listing->householdcleaning)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Maid::getHouseholdCleaning();
        $to_add     = '';
        foreach ((array)$this->listing->householdcleaning as $data) {
            $field .= $to_add . $this->t($views[$data]);
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Household and Cleaning', $internal_lng), $field, 'house_keeping');
    }
    ?>        
   
<?php $content = trim(ob_get_clean())?>
<?php if (!empty($content)):?>
<section class="category">
    <div id="detail_content_text_category">
            <?php echo $content ?>
    </div>
</section>
<?php endif;?>

<?php ob_start();?>
    <?php if (!empty($this->listing->reasonleavingpreviousjob)) {echo $this->dtDd($this->t('Reason for leaving previous job', $internal_lng), $this->listing->reasonleavingpreviousjob, 'reason_leave');}?>
    <?php
    if (!empty($this->listing->employmenttype)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Maid::getEmploymentType();
        $to_add     = '';
        foreach ((array)$this->listing->employmenttype as $data) {
            $field .= $to_add . $this->t($views[$data], $internal_lng);
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Employment Type', $internal_lng), $field, 'employment_type');
    }
    ?>
    <?php if (!empty($this->listing->availabletostart)) {echo $this->dtDd($this->t('Available to Start', $internal_lng), gmdate($this->listing->availabletostart), 'available_date');}?>
    <?php if (!empty($this->listing->visastatus)) {echo $this->dtDd($this->t('Visa Status', $internal_lng), $this->t($visastatus[$this->listing->visastatus], $internal_lng), 'visa_status');}?>        
    <?php if (!empty($this->listing->salary)) {echo $this->dtDd($this->t('Salary', $internal_lng), $this->t('__1__ HKD/month', null, $this->listing->salary), 'salary');}?>        
<?php $content = trim(ob_get_clean())?>
<?php if (!empty($content)):?>
    <section class="category">
        <div id="detail_content_text_category">
            <h2><?php echo $this->t('Employment Information', $internal_lng)?></h2>
            <?php echo $content ?>
        </div>
    </section>
<?php endif;?>        
        
<?php ob_start();?>
    <?php if (!empty($this->listing->previous_employers)) {echo $this->dtDd($this->t('Previous Employer References', $internal_lng), $this->listing->previous_employers);}?>
<?php $content = trim(ob_get_clean())?>
<?php if (!empty($content)):?>
    <section class="category">
        <div id="detail_content_text_category">
            <h2><?php echo $this->t('Additional Information', $internal_lng)?></h2>
            <dl class="employer_ref">
                <?php echo $content ?>
            </dl>
        </div>
    </section>
<?php endif;?>                